﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Prodma.DataAccess.Database;
using Prodma.DataAccess.Models;
using Prodma.DataAccess.Helper.Enumerators;
using System.Web.UI.WebControls;
using System.Web.Mvc;

namespace Prodma.DataAccess.DataService.ListService
{
    public class KategoriList
    {
        private static DataContext context = new DataContext();

        public static SelectList GetList()
        {
            DataContext context = new DataContext();

            using (context)
            {
                var list = (from kategori in context.STOK_GRUP
                            select kategori);

                SelectList selectList = new SelectList(list.ToDictionary(x => x.ID, z => z.AD), "Key", "Value");
                return selectList;
            }
        }
    }
}
